home *** CD-ROM | disk | FTP | other *** search
- <!-----------------------------------------------------------
- This example illustrates use of the JSStringFormat function.
- ----------------------------------------------------------->
- <HTML>
- <HEAD>
- <TITLE>JSStringFormat</TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
- <BODY bgcolor="#FFFFD5">
-
- <H3>JSStringFormat</H3>
-
- <CFSET stringValue = "An example string value with a tab chr(8) , a newline (chr10)
- and some ""quoted"" 'text'">
-
- <P>This is the string we have created:<BR>
- <CFOUTPUT>#stringValue#</cfoutput>
- </P>
- <CFSET jsStringValue = JSStringFormat(#stringValue#)>
-
- <!----------------------------------------------------------------------
- Here we generate an alert from the JavaScript string jsStringValue.
- ----------------------------------------------------------------------->
- <SCRIPT>
- s="<CFOUTPUT>#jsStringValue#</CFOUTPUT>";
- alert(s);
- </SCRIPT>
- </BODY>
- </HTML>